
package com.idealighter.game.games.blackjack.handler;

import com.google.inject.Inject;

import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.games.blackjack.manager.BlackjackMgr;
import com.idealighter.game.games.blackjack.message.ReqBetMsg;
import com.idealighter.game.message.ModuleMsgIdConstant;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.server.handler.ReqMessageHandler;


/**
 * 下注 .
 * 
 * @ClassName ReqBetHandler.
 * 
 * @author abin
 * @date 2018年3月19日 下午2:19:34 .
 */
@ReqMsgHandler(ModuleMsgIdConstant.Blackjack.BET)
public class ReqBetHandler implements ReqMessageHandler {

  @Inject
  private BlackjackMgr blackjackMgr;

  @Override
  public ResMessage action(Player player, ReqMessage message) {
    ReqBetMsg msg = (ReqBetMsg) message;
    return blackjackMgr.bet(player, msg.getBet());
  }
}
